package com.aikon.wht.concurrent;

public class T2 implements Runnable {

	private Integer cnt = 10;

	/**
	 * @return the cnt
	 */
	public Integer getCnt() {
		return cnt;
	}

	/**
	 * @param cnt
	 *            the cnt to set
	 */
	public void setCnt(Integer cnt) {
		this.cnt = cnt;
	}

	public void run() {
		synchronized (cnt) {
//			while (this.getCnt() > 0) {
//				System.out.println(Thread.currentThread().getName() + "******** " + getCnt());
//				setCnt(getCnt() - 1);
//			}
			try {
				Thread.sleep(10000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}

		}
	}

}
